home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
anti-i1a
/
antiid~1.frm
< prev
next >
Wrap
Text File
|
1999-09-25
|
9KB
|
354 lines
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "Anti-Idle"
ClientHeight = 1575
ClientLeft = 150
ClientTop = 720
ClientWidth = 4695
BeginProperty Font
Name = "Times New Roman"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "Anti Idle.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 1575
ScaleWidth = 4695
StartUpPosition = 3 'Windows Default
Begin VB.Timer Timer1
Interval = 1000
Left = 2160
Top = 480
End
Begin VB.CommandButton CmdIdle
Caption = "Anti-Idle is On"
Height = 495
Left = 0
Style = 1 'Graphical
TabIndex = 9
Top = 1080
Width = 4695
End
Begin VB.Frame Frame1
Caption = "# of Idles Clicked"
Height = 975
Left = 0
TabIndex = 0
Top = 0
Width = 2295
Begin VB.Label lbl46Min1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "0"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1560
TabIndex = 4
Top = 600
Width = 615
End
Begin VB.Label lbl10Min1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "0"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1560
TabIndex = 3
Top = 240
Width = 615
End
Begin VB.Label lbl46Min
BackStyle = 0 'Transparent
Caption = "46 Minute Idle:"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 2
Top = 600
Width = 1455
End
Begin VB.Label lbl10Min
BackStyle = 0 'Transparent
Caption = "10 Minute Idle:"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 1
Top = 240
Width = 1455
End
End
Begin VB.Frame Frame2
Caption = "Idle Limit"
Height = 975
Left = 2400
TabIndex = 5
Top = 0
Width = 2295
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 315
Left = 1200
MaxLength = 2
TabIndex = 8
Top = 480
Width = 975
End
Begin VB.CommandButton CmdSet
Caption = "Set Idle Limit"
Height = 615
Left = 120
Style = 1 'Graphical
TabIndex = 6
Top = 240
Width = 975
End
Begin VB.Label lblLimit
Caption = "Enter 1-99:"
Height = 255
Left = 1200
TabIndex = 7
Top = 240
Width = 975
End
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuIdle
Caption = "&Anti-Idle is On"
Shortcut = {F2}
End
Begin VB.Menu bar1
Caption = "-"
End
Begin VB.Menu mnuExit
Caption = "E&xit"
End
End
Begin VB.Menu mnuTrayMe
Caption = "&Tray Me"
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Min10 As Integer
Dim Min46 As Integer
Private Sub CmdIdle_Click()
If CmdIdle.Caption = "Anti-Idle is On" Then
'Turns Idle Off
CmdIdle.Caption = "Anti-Idle is Off"
CmdIdle.BackColor = vbCyan
mnuIdle.Caption = "&Anti-Idle is Off"
Timer1.Enabled = False
Else
'Turns Idle On
CmdIdle.Caption = "Anti-Idle is On"
CmdIdle.BackColor = vbYellow
mnuIdle.Caption = "&Anti-Idle is On"
Timer1.Enabled = True
End If
End Sub
Private Sub CmdSet_Click()
'Exit if textbox contains anything but numbers
If Text1.Text = "" Then Exit Sub
For x = 1 To 99
If Text1.Text = x Then GoTo NextStep:
Next x
Exit Sub
NextStep:
If CmdSet.Caption = "Set Idle Limit" Then
'Set Idle Limit
CmdSet.Caption = "Reset Idle Limit"
CmdSet.BackColor = vbYellow
Text1.Locked = True
Else
'Reset Idle Limit
CmdSet.Caption = "Set Idle Limit"
CmdSet.BackColor = vbCyan
Text1.Locked = False
End If
End Sub
Private Sub Form_Load()
'Allows only one instance
If App.PrevInstance Then End
'Initial Settings
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
Me.Hide
CmdIdle.Caption = "Anti-Idle is On"
CmdIdle.BackColor = vbYellow
mnuIdle.Caption = "&Anti-Idle is On"
CmdSet.Caption = "Set Idle Limit"
CmdSet.BackColor = vbCyan
Text1.Locked = False
Timer1.Enabled = True
lbl10Min1.Caption = "0"
lbl46Min1.Caption = "0"
'Add Program to System Tray
With nfIconData
.hwnd = Me.hwnd
.uID = Me.icon
.uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = Form1.icon.Handle
.szTip = Me.Caption & vbNullChar
.cbSize = Len(nfIconData)
End With
Shell_NotifyIcon NIM_ADD, nfIconData
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
'Tray Options
Dim lMsg As Single
lMsg = x / Screen.TwipsPerPixelX
Select Case lMsg
Case WM_LBUTTONUP
If Me.Visible = True Then
Me.Hide
Else
Me.Show
Timeout (0.01)
AppActivate Me.Caption
End If
Case WM_RBUTTONUP
Case WM_MOUSEMOVE
Case WM_LBUTTONDOWN
Case WM_LBUTTONDBLCLK
Case WM_RBUTTONDOWN
Case WM_RBUTTONDBLCLK
Case Else
End Select
End Sub
Private Sub mnuExit_Click()
End
End Sub
Private Sub mnuIdle_Click()
'Same as clicking the Button
CmdIdle_Click
End Sub
Private Sub mnuTrayMe_Click()
Me.Hide
End Sub
Private Sub Timer1_